home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / c2man-2.0pl33.lha / c2man-2.0 / amiga / y.tab.c < prev   
Encoding:
C/C++ Source or Header  |  1995-01-24  |  59.2 KB  |  1,934 lines

  1.  
  2. /*  A Bison parser, made from /grammar.y with Bison version GNU Bison version 1.22
  3.   */
  4.  
  5. #define YYBISON 1  /* Identify Bison output.  */
  6.  
  7. #define    T_IDENTIFIER    258
  8. #define    T_TYPEDEF_NAME    259
  9. #define    T_AUTO    260
  10. #define    T_EXTERN    261
  11. #define    T_REGISTER    262
  12. #define    T_STATIC    263
  13. #define    T_TYPEDEF    264
  14. #define    T_INLINE    265
  15. #define    T_CHAR    266
  16. #define    T_DOUBLE    267
  17. #define    T_FLOAT    268
  18. #define    T_INT    269
  19. #define    T_VOID    270
  20. #define    T_LONG    271
  21. #define    T_SHORT    272
  22. #define    T_SIGNED    273
  23. #define    T_UNSIGNED    274
  24. #define    T_ENUM    275
  25. #define    T_STRUCT    276
  26. #define    T_UNION    277
  27. #define    T_CONST    278
  28. #define    T_VOLATILE    279
  29. #define    T_CDECL    280
  30. #define    T_FAR    281
  31. #define    T_HUGE    282
  32. #define    T_INTERRUPT    283
  33. #define    T_NEAR    284
  34. #define    T_PASCAL    285
  35. #define    T_BRACES    286
  36. #define    T_BRACKETS    287
  37. #define    T_ELLIPSIS    288
  38. #define    T_INITIALIZER    289
  39. #define    T_STRING_LITERAL    290
  40. #define    T_COMMENT    291
  41. #define    T_EOLCOMMENT    292
  42. #define    T_BASEFILE    293
  43.  
  44. #line 69 "/grammar.y"
  45.  
  46. #include "c2man.h"
  47. #include "semantic.h"
  48. #include "strconcat.h"
  49. #include "strappend.h"
  50. #include "manpage.h"
  51. #include "enum.h"
  52.  
  53. #ifdef I_STDARG
  54. #include <stdarg.h>
  55. #endif
  56. #ifdef I_VARARGS
  57. #include <varargs.h>
  58. #endif
  59.  
  60. int yylex();
  61.  
  62. #define YYMAXDEPTH 150
  63.  
  64. /* where are we up to scanning through an enum? */
  65. static enum { NOENUM, KEYWORD, BRACES } enum_state = NOENUM;
  66.  
  67. /* Pointer to parameter list for the current function definition. */
  68. static ParameterList *func_params;
  69.  
  70. /* Table of typedef names */
  71. SymbolTable *typedef_names;
  72.  
  73. boolean first_comment;    /* are we still looking for the first comment? */
  74.  
  75. #ifndef YYLTYPE
  76. typedef
  77.   struct yyltype
  78.     {
  79.       int timestamp;
  80.       int first_line;
  81.       int first_column;
  82.       int last_line;
  83.       int last_column;
  84.       char *text;
  85.    }
  86.   yyltype;
  87.  
  88. #define YYLTYPE yyltype
  89. #endif
  90.  
  91. #ifndef YYSTYPE
  92. #define YYSTYPE int
  93. #endif
  94. #include <stdio.h>
  95.  
  96. #ifndef __cplusplus
  97. #ifndef __STDC__
  98. #define const
  99. #endif
  100. #endif
  101.  
  102.  
  103.  
  104. #define    YYFINAL        184
  105. #define    YYFLAG        -32768
  106. #define    YYNTBASE    46
  107.  
  108. #define YYTRANSLATE(x) ((unsigned)(x) <= 293 ? yytranslate[x] : 84)
  109.  
  110. static const char yytranslate[] = {     0,
  111.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  112.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  113.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  114.      2,     2,     2,     2,     2,     2,     2,     2,     2,    43,
  115.     44,    45,     2,    40,     2,     2,     2,     2,     2,     2,
  116.      2,     2,     2,     2,     2,     2,     2,     2,    39,     2,
  117.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  118.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  119.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  120.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  121.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  122.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  123.      2,     2,    41,     2,    42,     2,     2,     2,     2,     2,
  124.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  125.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  126.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  127.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  128.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  129.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  130.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  131.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  132.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  136.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  137.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  138.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  139.     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
  140.     36,    37,    38
  141. };
  142.  
  143. #if YYDEBUG != 0
  144. static const short yyprhs[] = {     0,
  145.      0,     1,     3,     5,     8,    11,    15,    18,    22,    26,
  146.     31,    33,    35,    37,    39,    42,    46,    50,    51,    58,
  147.     59,    65,    68,    72,    77,    79,    84,    87,    88,    90,
  148.     93,    97,   102,   104,   107,   109,   111,   113,   115,   117,
  149.    119,   121,   123,   125,   127,   129,   131,   133,   135,   137,
  150.    139,   141,   143,   145,   147,   149,   151,   153,   155,   157,
  151.    159,   161,   163,   167,   170,   173,   175,   177,   179,   184,
  152.    187,   189,   192,   199,   205,   208,   210,   215,   218,   222,
  153.    224,   226,   228,   231,   234,   237,   239,   241,   245,   248,
  154.    253,   258,   261,   265,   266,   269,   272,   280,   282,   287,
  155.    292,   297,   301,   302,   305,   307,   312,   316,   318,   321,
  156.    323,   327,   330,   332,   337,   341,   345,   348,   349,   351,
  157.    352
  158. };
  159.  
  160. static const short yyrhs[] = {    -1,
  161.     47,     0,    48,     0,    47,    48,     0,    53,    83,     0,
  162.     36,    53,    83,     0,    50,    83,     0,    36,    50,    83,
  163.      0,    50,    39,    83,     0,    36,    50,    39,    83,     0,
  164.     49,     0,    36,     0,    37,     0,    38,     0,     1,    39,
  165.      0,     6,    35,    31,     0,     6,    35,    53,     0,     0,
  166.     57,    70,    83,    51,    55,    31,     0,     0,    70,    83,
  167.     52,    55,    31,     0,    57,    39,     0,    57,    64,    39,
  168.      0,     9,    57,    54,    39,     0,    70,     0,    54,    40,
  169.     83,    70,     0,    54,    83,     0,     0,    56,     0,    56,
  170.     33,     0,    82,    53,    83,     0,    56,    82,    53,    83,
  171.      0,    58,     0,    57,    58,     0,    59,     0,    60,     0,
  172.     61,     0,     5,     0,     6,     0,     7,     0,     8,     0,
  173.     10,     0,    11,     0,    12,     0,    13,     0,    14,     0,
  174.     16,     0,    17,     0,    18,     0,    19,     0,    15,     0,
  175.     62,     0,    66,     0,     4,     0,    23,     0,    24,     0,
  176.     25,     0,    28,     0,    26,     0,    27,     0,    29,     0,
  177.     30,     0,    63,    69,    31,     0,    63,    31,     0,    63,
  178.     69,     0,    21,     0,    22,     0,    65,     0,    64,    40,
  179.     83,    65,     0,    64,    83,     0,    70,     0,    70,    34,
  180.      0,    20,    69,    41,    83,    67,    42,     0,    20,    41,
  181.     83,    67,    42,     0,    20,    69,     0,    68,     0,    67,
  182.     40,    83,    68,     0,    67,    83,     0,    67,    40,    83,
  183.      0,    79,     0,     3,     0,     4,     0,    69,    36,     0,
  184.     69,    37,     0,    72,    71,     0,    71,     0,     3,     0,
  185.     43,    70,    44,     0,    71,    32,     0,    71,    43,    74,
  186.     44,     0,    71,    43,    77,    44,     0,    45,    73,     0,
  187.     45,    73,    72,     0,     0,    73,    61,     0,    75,    83,
  188.      0,    75,    40,    83,    82,    33,    82,    83,     0,    76,
  189.      0,    75,    40,    83,    76,     0,    82,    57,    70,    82,
  190.      0,    82,    57,    80,    82,     0,    82,    57,    82,     0,
  191.      0,    78,    83,     0,    79,     0,    78,    40,    83,    79,
  192.      0,    82,     3,    82,     0,    72,     0,    72,    81,     0,
  193.     81,     0,    43,    80,    44,     0,    81,    32,     0,    32,
  194.      0,    81,    43,    74,    44,     0,    81,    43,    44,     0,
  195.     43,    74,    44,     0,    43,    44,     0,     0,    36,     0,
  196.      0,    37,     0
  197. };
  198.  
  199. #endif
  200.  
  201. #if YYDEBUG != 0
  202. static const short yyrline[] = { 0,
  203.    102,   103,   107,   108,   112,   116,   120,   126,   131,   137,
  204.    142,   143,   152,   156,   160,   167,   174,   181,   190,   198,
  205.    207,   220,   225,   230,   239,   243,   248,   256,   257,   258,
  206.    262,   266,   273,   274,   281,   282,   283,   287,   291,   295,
  207.    299,   303,   310,   314,   318,   322,   326,   330,   334,   338,
  208.    342,   346,   347,   348,   359,   363,   367,   371,   375,   379,
  209.    383,   387,   394,   399,   403,   411,   415,   422,   426,   431,
  210.    439,   440,   444,   453,   459,   469,   473,   479,   484,   492,
  211.    499,   500,   501,   506,   514,   523,   527,   531,   538,   544,
  212.    552,   563,   568,   578,   582,   592,   597,   624,   628,   636,
  213.    640,   644,   651,   655,   663,   668,   676,   684,   688,   697,
  214.    701,   708,   714,   718,   726,   733,   743,   755,   759,   763,
  215.    767
  216. };
  217.  
  218. static const char * const yytname[] = {   "$","error","$illegal.","T_IDENTIFIER",
  219. "T_TYPEDEF_NAME","T_AUTO","T_EXTERN","T_REGISTER","T_STATIC","T_TYPEDEF","T_INLINE",
  220. "T_CHAR","T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED",
  221. "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_CONST","T_VOLATILE","T_CDECL",
  222. "T_FAR","T_HUGE","T_INTERRUPT","T_NEAR","T_PASCAL","T_BRACES","T_BRACKETS","T_ELLIPSIS",
  223. "T_INITIALIZER","T_STRING_LITERAL","T_COMMENT","T_EOLCOMMENT","T_BASEFILE","';'",
  224. "','","'{'","'}'","'('","')'","'*'","program","translation_unit","external_declaration",
  225. "linkage_specification","function_definition","@1","@2","declaration","declarator_list",
  226. "opt_declaration_list","declaration_list","declaration_specifiers","declaration_specifier",
  227. "storage_class","type_specifier","type_qualifier","struct_or_union_specifier",
  228. "struct_or_union","init_declarator_list","init_declarator","enum_specifier",
  229. "enumerator_list","enumerator","any_id","declarator","direct_declarator","pointer",
  230. "type_qualifier_list","parameter_type_list","parameter_list","parameter_declaration",
  231. "opt_identifier_list","identifier_list","identifier","abstract_declarator","direct_abstract_declarator",
  232. "opt_comment","opt_eolcomment",""
  233. };
  234. #endif
  235.  
  236. static const short yyr1[] = {     0,
  237.     46,    46,    47,    47,    48,    48,    48,    48,    48,    48,
  238.     48,    48,    48,    48,    48,    49,    49,    51,    50,    52,
  239.     50,    53,    53,    53,    54,    54,    54,    55,    55,    55,
  240.     56,    56,    57,    57,    58,    58,    58,    59,    59,    59,
  241.     59,    59,    60,    60,    60,    60,    60,    60,    60,    60,
  242.     60,    60,    60,    60,    61,    61,    61,    61,    61,    61,
  243.     61,    61,    62,    62,    62,    63,    63,    64,    64,    64,
  244.     65,    65,    66,    66,    66,    67,    67,    67,    67,    68,
  245.     69,    69,    69,    69,    70,    70,    71,    71,    71,    71,
  246.     71,    72,    72,    73,    73,    74,    74,    75,    75,    76,
  247.     76,    76,    77,    77,    78,    78,    79,    80,    80,    80,
  248.     81,    81,    81,    81,    81,    81,    81,    82,    82,    83,
  249.     83
  250. };
  251.  
  252. static const short yyr2[] = {     0,
  253.      0,     1,     1,     2,     2,     3,     2,     3,     3,     4,
  254.      1,     1,     1,     1,     2,     3,     3,     0,     6,     0,
  255.      5,     2,     3,     4,     1,     4,     2,     0,     1,     2,
  256.      3,     4,     1,     2,     1,     1,     1,     1,     1,     1,
  257.      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  258.      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  259.      1,     1,     3,     2,     2,     1,     1,     1,     4,     2,
  260.      1,     2,     6,     5,     2,     1,     4,     2,     3,     1,
  261.      1,     1,     2,     2,     2,     1,     1,     3,     2,     4,
  262.      4,     2,     3,     0,     2,     2,     7,     1,     4,     4,
  263.      4,     3,     0,     2,     1,     4,     3,     1,     2,     1,
  264.      3,     2,     1,     4,     3,     3,     2,     0,     1,     0,
  265.      1
  266. };
  267.  
  268. static const short yydefact[] = {     0,
  269.      0,    87,    54,    38,    39,    40,    41,     0,    42,    43,
  270.     44,    45,    46,    51,    47,    48,    49,    50,     0,    66,
  271.     67,    55,    56,    57,    59,    60,    58,    61,    62,    12,
  272.     13,    14,     0,    94,     0,     3,    11,   120,   120,     0,
  273.     33,    35,    36,    37,    52,     0,    53,   120,    86,     0,
  274.     15,     0,    39,     0,    81,    82,   120,    75,   120,   120,
  275.      0,    92,     4,   121,   120,     7,     5,    22,    34,     0,
  276.     68,   120,    64,    65,    20,    89,   118,    85,    16,    17,
  277.      0,     0,    25,   118,    83,    84,   120,   120,     8,     6,
  278.     88,    95,    93,     9,    23,   120,    70,    72,    18,    63,
  279.    118,   119,     0,   120,    98,     0,   120,   105,     0,    71,
  280.     24,   120,    27,     0,    76,    80,     0,   118,    10,     0,
  281.    118,     0,   118,     0,    90,   120,    96,    91,   120,   104,
  282.    118,   118,     0,   120,    74,    78,     0,    69,     0,    21,
  283.     30,     0,   120,   118,   118,   107,   113,   118,   118,   108,
  284.    118,   110,   102,    26,    79,    73,    19,   120,    31,    99,
  285.      0,   106,   117,     0,     0,     0,   100,   109,   101,   112,
  286.    118,    77,    32,   118,   116,   111,   115,     0,   120,   114,
  287.     97,     0,     0,     0
  288. };
  289.  
  290. static const short yydefgoto[] = {   182,
  291.     35,    36,    37,    38,   121,   101,    39,    82,   122,   123,
  292.     40,    41,    42,    43,    44,    45,    46,    70,    71,    47,
  293.    114,   115,    58,    48,    49,    50,    62,   103,   104,   105,
  294.    106,   107,   116,   151,   152,   117,   136
  295. };
  296.  
  297. static const short yypact[] = {   169,
  298.    -12,-32768,-32768,-32768,    -4,-32768,-32768,   542,-32768,-32768,
  299. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,     2,-32768,
  300. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,   301,
  301. -32768,-32768,    15,-32768,   215,-32768,-32768,    57,     3,   344,
  302. -32768,-32768,-32768,-32768,-32768,    33,-32768,     3,   -13,     9,
  303. -32768,   459,-32768,   387,-32768,-32768,     3,    42,    76,     3,
  304.     17,   550,-32768,-32768,     3,-32768,-32768,-32768,-32768,    87,
  305. -32768,    29,-32768,    40,-32768,-32768,   -19,   -13,-32768,-32768,
  306.    344,    93,-32768,     5,-32768,-32768,     3,     3,-32768,-32768,
  307. -32768,-32768,-32768,-32768,-32768,     3,-32768,-32768,-32768,-32768,
  308.     74,-32768,    36,    53,-32768,    37,    98,-32768,   488,    13,
  309. -32768,     3,-32768,    45,-32768,-32768,    62,     5,-32768,    15,
  310.     74,    71,    55,   515,-32768,     3,-32768,-32768,     3,-32768,
  311.      5,   258,    15,     3,-32768,-32768,    72,-32768,    80,-32768,
  312. -32768,   515,     3,     5,     5,-32768,-32768,    10,     5,     6,
  313.      5,    30,-32768,-32768,    21,-32768,-32768,     3,-32768,-32768,
  314.    429,-32768,-32768,    73,    75,   542,-32768,    30,-32768,-32768,
  315.    -10,-32768,-32768,     5,-32768,-32768,-32768,    81,     3,-32768,
  316. -32768,   131,   136,-32768
  317. };
  318.  
  319. static const short yypgoto[] = {-32768,
  320. -32768,   102,-32768,   109,-32768,-32768,   -20,-32768,    19,-32768,
  321.     -8,   -33,-32768,-32768,    82,-32768,-32768,-32768,    23,-32768,
  322.     31,    -5,   101,   -25,   -47,   -48,-32768,  -132,-32768,     7,
  323. -32768,-32768,   -73,     4,    11,    -3,   -37
  324. };
  325.  
  326.  
  327. #define    YYLAST        595
  328.  
  329.  
  330. static const short yytable[] = {    54,
  331.     66,    67,    78,   108,    55,    56,    69,    61,     2,    60,
  332.     75,     2,     2,    93,    72,   164,   102,     2,    76,    84,
  333.     69,    89,    90,  -118,  -103,   102,    51,    94,    83,    77,
  334.     52,    80,    97,   177,    99,    55,    56,   147,   178,    64,
  335.    102,   147,    57,    81,   113,   102,    98,    69,   148,   118,
  336.    119,    33,   148,   163,    34,   110,   102,    33,   120,    34,
  337.     91,   170,    98,    73,   131,    64,   127,   -71,   -71,   130,
  338.    100,   162,   171,   109,   133,    85,    86,    85,    86,   125,
  339.    128,    64,    87,   150,   134,   -29,   135,   141,   144,    64,
  340.    102,   145,   126,    64,   110,    65,   155,   124,    69,   150,
  341.    132,   140,    78,   143,   -28,   159,   149,   154,    64,   102,
  342.    157,   134,    64,   156,    88,    81,   175,   124,   176,   142,
  343.    173,   158,    61,    64,   180,    95,    96,   146,   153,    64,
  344.    183,   111,   112,    81,    64,   184,    63,   129,    59,   139,
  345.    161,   181,   138,    92,   166,   167,    74,   169,   137,   172,
  346.    160,   165,   132,     0,     0,     0,     0,   132,     0,     0,
  347.    168,     0,     0,     0,     0,     0,     0,   166,    -1,     1,
  348.    179,     2,     3,     4,     5,     6,     7,     8,     9,    10,
  349.     11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
  350.     21,    22,    23,    24,    25,    26,    27,    28,    29,     0,
  351.      0,     0,     0,     0,    30,    31,    32,     0,     0,     0,
  352.      0,    33,     0,    34,    -2,     1,     0,     2,     3,     4,
  353.      5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  354.     15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  355.     25,    26,    27,    28,    29,     0,     0,     0,     0,     0,
  356.     30,    31,    32,     0,     0,     0,     0,    33,     0,    34,
  357.      2,     3,     4,    53,     6,     7,     0,     9,    10,    11,
  358.     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
  359.     22,    23,    24,    25,    26,    27,    28,    29,     0,   147,
  360.      0,     0,     0,   102,     0,     0,     0,     0,     0,     0,
  361.    148,     0,    34,     2,     3,     4,    53,     6,     7,     8,
  362.      9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
  363.     19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  364.     29,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  365.      0,     0,     0,    33,     0,    34,     2,     3,     4,    53,
  366.      6,     7,     0,     9,    10,    11,    12,    13,    14,    15,
  367.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  368.     26,    27,    28,    29,     0,     0,     0,     0,     0,     0,
  369.      0,     0,    68,     0,     0,     0,    33,     0,    34,     2,
  370.      3,     4,    53,     6,     7,     0,     9,    10,    11,    12,
  371.     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
  372.     23,    24,    25,    26,    27,    28,    29,     0,     0,     0,
  373.      0,     0,     0,     0,     0,     0,     0,     0,     0,    33,
  374.      0,    34,     3,     4,    53,     6,     7,     0,     9,    10,
  375.     11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
  376.     21,    22,    23,    24,    25,    26,    27,    28,    29,     0,
  377.      0,   174,     3,     4,    53,     6,     7,     8,     9,    10,
  378.     11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
  379.     21,    22,    23,    24,    25,    26,    27,    28,    29,    79,
  380.    131,     3,     4,    53,     6,     7,     0,     9,    10,    11,
  381.     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
  382.     22,    23,    24,    25,    26,    27,    28,    29,     3,     4,
  383.     53,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  384.     15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
  385.     25,    26,    27,    28,    29,     3,     4,    53,     6,     7,
  386.      0,     9,    10,    11,    12,    13,    14,    15,    16,    17,
  387.     18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
  388.     28,    29,    22,    23,    24,    25,    26,    27,    28,    29,
  389.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  390.      0,     0,     0,     0,    34
  391. };
  392.  
  393. static const short yycheck[] = {     8,
  394.     38,    39,    50,    77,     3,     4,    40,    33,     3,    30,
  395.     48,     3,     3,    62,    40,   148,    36,     3,    32,    57,
  396.     54,    59,    60,     3,    44,    36,    39,    65,    54,    43,
  397.     35,    52,    70,    44,    72,     3,     4,    32,   171,    37,
  398.     36,    32,    41,    52,    82,    36,    34,    81,    43,    87,
  399.     88,    43,    43,    44,    45,    81,    36,    43,    96,    45,
  400.     44,    32,    34,    31,     3,    37,   104,    39,    40,   107,
  401.     31,   145,    43,    77,   112,    36,    37,    36,    37,    44,
  402.     44,    37,    41,   132,    40,    31,    42,    33,   126,    37,
  403.     36,   129,    40,    37,   120,    39,   134,   101,   132,   148,
  404.    109,    31,   150,   124,    31,   143,   132,   133,    37,    36,
  405.     31,    40,    37,    42,    39,   124,    44,   121,    44,   123,
  406.    158,   142,   148,    37,    44,    39,    40,   131,   132,    37,
  407.      0,    39,    40,   142,    37,     0,    35,    40,    30,   121,
  408.    144,   179,   120,    62,   148,   149,    46,   151,   118,   155,
  409.    144,   148,   161,    -1,    -1,    -1,    -1,   166,    -1,    -1,
  410.    150,    -1,    -1,    -1,    -1,    -1,    -1,   171,     0,     1,
  411.    174,     3,     4,     5,     6,     7,     8,     9,    10,    11,
  412.     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
  413.     22,    23,    24,    25,    26,    27,    28,    29,    30,    -1,
  414.     -1,    -1,    -1,    -1,    36,    37,    38,    -1,    -1,    -1,
  415.     -1,    43,    -1,    45,     0,     1,    -1,     3,     4,     5,
  416.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  417.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  418.     26,    27,    28,    29,    30,    -1,    -1,    -1,    -1,    -1,
  419.     36,    37,    38,    -1,    -1,    -1,    -1,    43,    -1,    45,
  420.      3,     4,     5,     6,     7,     8,    -1,    10,    11,    12,
  421.     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
  422.     23,    24,    25,    26,    27,    28,    29,    30,    -1,    32,
  423.     -1,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,    -1,
  424.     43,    -1,    45,     3,     4,     5,     6,     7,     8,     9,
  425.     10,    11,    12,    13,    14,    15,    16,    17,    18,    19,
  426.     20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
  427.     30,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  428.     -1,    -1,    -1,    43,    -1,    45,     3,     4,     5,     6,
  429.      7,     8,    -1,    10,    11,    12,    13,    14,    15,    16,
  430.     17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
  431.     27,    28,    29,    30,    -1,    -1,    -1,    -1,    -1,    -1,
  432.     -1,    -1,    39,    -1,    -1,    -1,    43,    -1,    45,     3,
  433.      4,     5,     6,     7,     8,    -1,    10,    11,    12,    13,
  434.     14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
  435.     24,    25,    26,    27,    28,    29,    30,    -1,    -1,    -1,
  436.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    43,
  437.     -1,    45,     4,     5,     6,     7,     8,    -1,    10,    11,
  438.     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
  439.     22,    23,    24,    25,    26,    27,    28,    29,    30,    -1,
  440.     -1,    33,     4,     5,     6,     7,     8,     9,    10,    11,
  441.     12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
  442.     22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
  443.      3,     4,     5,     6,     7,     8,    -1,    10,    11,    12,
  444.     13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
  445.     23,    24,    25,    26,    27,    28,    29,    30,     4,     5,
  446.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  447.     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  448.     26,    27,    28,    29,    30,     4,     5,     6,     7,     8,
  449.     -1,    10,    11,    12,    13,    14,    15,    16,    17,    18,
  450.     19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  451.     29,    30,    23,    24,    25,    26,    27,    28,    29,    30,
  452.     -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
  453.     -1,    -1,    -1,    -1,    45
  454. };
  455. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  456. #line 3 "bison.simple"
  457.  
  458. /* Skeleton output parser for bison,
  459.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  460.  
  461.    This program is free software; you can redistribute it and/or modify
  462.    it under the terms of the GNU General Public License as published by
  463.    the Free Software Foundation; either version 1, or (at your option)
  464.    any later version.
  465.  
  466.    This program is distributed in the hope that it will be useful,
  467.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  468.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  469.    GNU General Public License for more details.
  470.  
  471.    You should have received a copy of the GNU General Public License
  472.    along with this program; if not, write to the Free Software
  473.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  474.  
  475. #ifdef __SASC
  476. #define alloca    malloc
  477. #endif
  478.  
  479. #ifndef alloca
  480. #ifdef __GNUC__
  481. #define alloca __builtin_alloca
  482. #else /* not GNU C.  */
  483. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
  484. #include <alloca.h>
  485. #else /* not sparc */
  486. #if defined (MSDOS) && !defined (__TURBOC__)
  487. #include <malloc.h>
  488. #else /* not MSDOS, or __TURBOC__ */
  489. #if defined(_AIX)
  490. #include <malloc.h>
  491.  #pragma alloca
  492. #else /* not MSDOS, __TURBOC__, or _AIX */
  493. #ifdef __hpux
  494. #ifdef __cplusplus
  495. extern "C" {
  496. void *alloca (unsigned int);
  497. };
  498. #else /* not __cplusplus */
  499. void *alloca ();
  500. #endif /* not __cplusplus */
  501. #endif /* __hpux */
  502. #endif /* not _AIX */
  503. #endif /* not MSDOS, or __TURBOC__ */
  504. #endif /* not sparc.  */
  505. #endif /* not GNU C.  */
  506. #endif /* alloca not defined.  */
  507.  
  508. /* This is the parser code that is written into each bison parser
  509.   when the %semantic_parser declaration is not specified in the grammar.
  510.   It was written by Richard Stallman by simplifying the hairy parser
  511.   used when %semantic_parser is specified.  */
  512.  
  513. /* Note: there must be only one dollar sign in this file.
  514.    It is replaced by the list of actions, each action
  515.    as one case of the switch.  */
  516.  
  517. #define yyerrok         (yyerrstatus = 0)
  518. #define yyclearin       (yychar = YYEMPTY)
  519. #define YYEMPTY         -2
  520. #define YYEOF           0
  521. #define YYACCEPT        return(0)
  522. #define YYABORT         return(1)
  523. #define YYERROR         goto yyerrlab1
  524. /* Like YYERROR except do call yyerror.
  525.    This remains here temporarily to ease the
  526.    transition to the new meaning of YYERROR, for GCC.
  527.    Once GCC version 2 has supplanted version 1, this can go.  */
  528. #define YYFAIL          goto yyerrlab
  529. #define YYRECOVERING()  (!!yyerrstatus)
  530. #define YYBACKUP(token, value) \
  531. do                                                              \
  532.   if (yychar == YYEMPTY && yylen == 1)                          \
  533.     { yychar = (token), yylval = (value);                       \
  534.       yychar1 = YYTRANSLATE (yychar);                           \
  535.       YYPOPSTACK;                                               \
  536.       goto yybackup;                                            \
  537.     }                                                           \
  538.   else                                                          \
  539.     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
  540. while (0)
  541.  
  542. #define YYTERROR        1
  543. #define YYERRCODE       256
  544.  
  545. #ifndef YYPURE
  546. #define YYLEX           yylex()
  547. #endif
  548.  
  549. #ifdef YYPURE
  550. #ifdef YYLSP_NEEDED
  551. #define YYLEX           yylex(&yylval, &yylloc)
  552. #else
  553. #define YYLEX           yylex(&yylval)
  554. #endif
  555. #endif
  556.  
  557. /* If nonreentrant, generate the variables here */
  558.  
  559. #ifndef YYPURE
  560.  
  561. int     yychar;                 /*  the lookahead symbol                */
  562. YYSTYPE yylval;                 /*  the semantic value of the           */
  563.                                 /*  lookahead symbol                    */
  564.  
  565. #ifdef YYLSP_NEEDED
  566. YYLTYPE yylloc;                 /*  location data for the lookahead     */
  567.                                 /*  symbol                              */
  568. #endif
  569.  
  570. int yynerrs;                    /*  number of parse errors so far       */
  571. #endif  /* not YYPURE */
  572.  
  573. #if YYDEBUG != 0
  574. int yydebug;                    /*  nonzero means print parse trace     */
  575. /* Since this is uninitialized, it does not stop multiple parsers
  576.    from coexisting.  */
  577. #endif
  578.  
  579. /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
  580.  
  581. #ifndef YYINITDEPTH
  582. #define YYINITDEPTH 200
  583. #endif
  584.  
  585. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  586.     (effective only if the built-in stack extension method is used).  */
  587.  
  588. #if YYMAXDEPTH == 0
  589. #undef YYMAXDEPTH
  590. #endif
  591.  
  592. #ifndef YYMAXDEPTH
  593. #define YYMAXDEPTH 10000
  594. #endif
  595.  
  596. /* Prevent warning if -Wstrict-prototypes.  */
  597. #ifdef __GNUC__
  598. int yyparse (void);
  599. #endif
  600.  
  601. #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
  602. #define __yy_bcopy(FROM,TO,COUNT)       __builtin_memcpy(TO,FROM,COUNT)
  603. #else                           /* not GNU C or C++ */
  604. #ifndef __cplusplus
  605.  
  606. /* This is the most reliable way to avoid incompatibilities
  607.    in available built-in functions on various systems.  */
  608. static void
  609. __yy_bcopy (from, to, count)
  610.      char *from;
  611.      char *to;
  612.      int count;
  613. {
  614.   register char *f = from;
  615.   register char *t = to;
  616.   register int i = count;
  617.  
  618.   while (i-- > 0)
  619.     *t++ = *f++;
  620. }
  621.  
  622. #else /* __cplusplus */
  623.  
  624. /* This is the most reliable way to avoid incompatibilities
  625.    in available built-in functions on various systems.  */
  626. static void
  627. __yy_bcopy (char *from, char *to, int count)
  628. {
  629.   register char *f = from;
  630.   register char *t = to;
  631.   register int i = count;
  632.  
  633.   while (i-- > 0)
  634.     *t++ = *f++;
  635. }
  636.  
  637. #endif
  638. #endif
  639.  
  640. #line 184 "bison.simple"
  641. int
  642. yyparse()
  643. {
  644.   register int yystate;
  645.   register int yyn;
  646.   register short *yyssp;
  647.   register YYSTYPE *yyvsp;
  648.   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
  649.   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
  650.  
  651.   short yyssa[YYINITDEPTH];     /*  the state stack                     */
  652.   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
  653.  
  654.   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
  655.   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
  656.  
  657. #ifdef YYLSP_NEEDED
  658.   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
  659.   YYLTYPE *yyls = yylsa;
  660.   YYLTYPE *yylsp;
  661.  
  662. #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
  663. #else
  664. #define YYPOPSTACK   (yyvsp--, yyssp--)
  665. #endif
  666.  
  667.   int yystacksize = YYINITDEPTH;
  668.  
  669. #ifdef YYPURE
  670.   int yychar;
  671.   YYSTYPE yylval;
  672.   int yynerrs;
  673. #ifdef YYLSP_NEEDED
  674.   YYLTYPE yylloc;
  675. #endif
  676. #endif
  677.  
  678.   YYSTYPE yyval;                /*  the variable used to return         */
  679.                                 /*  semantic values from the action     */
  680.                                 /*  routines                            */
  681.  
  682.   int yylen;
  683.  
  684. #if YYDEBUG != 0
  685.   if (yydebug)
  686.     fprintf(stderr, "Starting parse\n");
  687. #endif
  688.  
  689.   yystate = 0;
  690.   yyerrstatus = 0;
  691.   yynerrs = 0;
  692.   yychar = YYEMPTY;             /* Cause a token to be read.  */
  693.  
  694.   /* Initialize stack pointers.
  695.      Waste one element of value and location stack
  696.      so that they stay on the same level as the state stack.
  697.      The wasted elements are never initialized.  */
  698.  
  699.   yyssp = yyss - 1;
  700.   yyvsp = yyvs;
  701. #ifdef YYLSP_NEEDED
  702.   yylsp = yyls;
  703. #endif
  704.  
  705. /* Push a new state, which is found in  yystate  .  */
  706. /* In all cases, when you get here, the value and location stacks
  707.    have just been pushed. so pushing a state here evens the stacks.  */
  708. yynewstate:
  709.  
  710.   *++yyssp = (short) yystate;
  711.  
  712.   if (yyssp >= yyss + yystacksize - 1)
  713.     {
  714.       /* Give user a chance to reallocate the stack */
  715.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  716.       YYSTYPE *yyvs1 = yyvs;
  717.       short *yyss1 = yyss;
  718. #ifdef YYLSP_NEEDED
  719.       YYLTYPE *yyls1 = yyls;
  720. #endif
  721.  
  722.       /* Get the current used size of the three stacks, in elements.  */
  723.       int size = yyssp - yyss + 1;
  724.  
  725. #ifdef yyoverflow
  726.       /* Each stack pointer address is followed by the size of
  727.          the data in use in that stack, in bytes.  */
  728. #ifdef YYLSP_NEEDED
  729.       /* This used to be a conditional around just the two extra args,
  730.          but that might be undefined if yyoverflow is a macro.  */
  731.       yyoverflow("parser stack overflow",
  732.                  &yyss1, size * sizeof (*yyssp),
  733.                  &yyvs1, size * sizeof (*yyvsp),
  734.                  &yyls1, size * sizeof (*yylsp),
  735.                  &yystacksize);
  736. #else
  737.       yyoverflow("parser stack overflow",
  738.                  &yyss1, size * sizeof (*yyssp),
  739.                  &yyvs1, size * sizeof (*yyvsp),
  740.                  &yystacksize);
  741. #endif
  742.  
  743.       yyss = yyss1; yyvs = yyvs1;
  744. #ifdef YYLSP_NEEDED
  745.       yyls = yyls1;
  746. #endif
  747. #else /* no yyoverflow */
  748.       /* Extend the stack our own way.  */
  749.       if (yystacksize >= YYMAXDEPTH)
  750.         {
  751.           yyerror("parser stack overflow");
  752.           return 2;
  753.         }
  754.       yystacksize *= 2;
  755.       if (yystacksize > YYMAXDEPTH)
  756.         yystacksize = YYMAXDEPTH;
  757.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  758.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  759.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  760.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  761. #ifdef YYLSP_NEEDED
  762.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  763.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  764. #endif
  765. #endif /* no yyoverflow */
  766.  
  767.       yyssp = yyss + size - 1;
  768.       yyvsp = yyvs + size - 1;
  769. #ifdef YYLSP_NEEDED
  770.       yylsp = yyls + size - 1;
  771. #endif
  772.  
  773. #if YYDEBUG != 0
  774.       if (yydebug)
  775.         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  776. #endif
  777.  
  778.       if (yyssp >= yyss + yystacksize - 1)
  779.         YYABORT;
  780.     }
  781.  
  782. #if YYDEBUG != 0
  783.   if (yydebug)
  784.     fprintf(stderr, "Entering state %d\n", yystate);
  785. #endif
  786.  
  787.   goto yybackup;
  788.  yybackup:
  789.  
  790. /* Do appropriate processing given the current state.  */
  791. /* Read a lookahead token if we need one and don't already have one.  */
  792. /* yyresume: */
  793.  
  794.   /* First try to decide what to do without reference to lookahead token.  */
  795.  
  796.   yyn = yypact[yystate];
  797.   if (yyn == YYFLAG)
  798.     goto yydefault;
  799.  
  800.   /* Not known => get a lookahead token if don't already have one.  */
  801.  
  802.   /* yychar is either YYEMPTY or YYEOF
  803.      or a valid token in external form.  */
  804.  
  805.   if (yychar == YYEMPTY)
  806.     {
  807. #if YYDEBUG != 0
  808.       if (yydebug)
  809.         fprintf(stderr, "Reading a token: ");
  810. #endif
  811.       yychar = YYLEX;
  812.     }
  813.  
  814.   /* Convert token to internal form (in yychar1) for indexing tables with */
  815.  
  816.   if (yychar <= 0)              /* This means end of input. */
  817.     {
  818.       yychar1 = 0;
  819.       yychar = YYEOF;           /* Don't call YYLEX any more */
  820.  
  821. #if YYDEBUG != 0
  822.       if (yydebug)
  823.         fprintf(stderr, "Now at end of input.\n");
  824. #endif
  825.     }
  826.   else
  827.     {
  828.       yychar1 = YYTRANSLATE(yychar);
  829.  
  830. #if YYDEBUG != 0
  831.       if (yydebug)
  832.         {
  833.           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
  834.           /* Give the individual parser a way to print the precise meaning
  835.              of a token, for further debugging info.  */
  836. #ifdef YYPRINT
  837.           YYPRINT (stderr, yychar, yylval);
  838. #endif
  839.           fprintf (stderr, ")\n");
  840.         }
  841. #endif
  842.     }
  843.  
  844.   yyn += yychar1;
  845.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  846.     goto yydefault;
  847.  
  848.   yyn = yytable[yyn];
  849.  
  850.   /* yyn is what to do for this token type in this state.
  851.      Negative => reduce, -yyn is rule number.
  852.      Positive => shift, yyn is new state.
  853.        New state is final state => don't bother to shift,
  854.        just return success.
  855.      0, or most negative number => error.  */
  856.  
  857.   if (yyn < 0)
  858.     {
  859.       if (yyn == YYFLAG)
  860.         goto yyerrlab;
  861.       yyn = -yyn;
  862.       goto yyreduce;
  863.     }
  864.   else if (yyn == 0)
  865.     goto yyerrlab;
  866.  
  867.   if (yyn == YYFINAL)
  868.     YYACCEPT;
  869.  
  870.   /* Shift the lookahead token.  */
  871.  
  872. #if YYDEBUG != 0
  873.   if (yydebug)
  874.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  875. #endif
  876.  
  877.   /* Discard the token being shifted unless it is eof.  */
  878.   if (yychar != YYEOF)
  879.     yychar = YYEMPTY;
  880.  
  881.   *++yyvsp = yylval;
  882. #ifdef YYLSP_NEEDED
  883.   *++yylsp = yylloc;
  884. #endif
  885.  
  886.   /* count tokens shifted since error; after three, turn off error status.  */
  887.   if (yyerrstatus) yyerrstatus--;
  888.  
  889.   yystate = yyn;
  890.   goto yynewstate;
  891.  
  892. /* Do the default action for the current state.  */
  893. yydefault:
  894.  
  895.   yyn = yydefact[yystate];
  896.   if (yyn == 0)
  897.     goto yyerrlab;
  898.  
  899. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  900. yyreduce:
  901.   yylen = yyr2[yyn];
  902.   if (yylen > 0)
  903.     yyval = yyvsp[1-yylen]; /* implement default value of the action */
  904.  
  905. #if YYDEBUG != 0
  906.   if (yydebug)
  907.     {
  908.       int i;
  909.  
  910.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  911.                yyn, yyrline[yyn]);
  912.  
  913.       /* Print the symbols being reduced, and their result.  */
  914.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  915.         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  916.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  917.     }
  918. #endif
  919.  
  920.  
  921.   switch (yyn) {
  922.  
  923. case 5:
  924. #line 113 "/grammar.y"
  925. {
  926.         remember_declarations(NULL, &yyvsp[-1].declaration.decl_spec, &yyvsp[-1].declaration.decl_list, yyvsp[0].text);
  927.     ;
  928.     break;}
  929. case 6:
  930. #line 117 "/grammar.y"
  931. {
  932.         remember_declarations(yyvsp[-2].text, &yyvsp[-1].declaration.decl_spec, &yyvsp[-1].declaration.decl_list, yyvsp[0].text);
  933.     ;
  934.     break;}
  935. case 7:
  936. #line 121 "/grammar.y"
  937. {
  938.         free_declarator(yyvsp[-1].parameter.declarator);
  939.         free_decl_spec(&yyvsp[-1].parameter.decl_spec);
  940.         safe_free(yyvsp[0].text);
  941.     ;
  942.     break;}
  943. case 8:
  944. #line 127 "/grammar.y"
  945. {
  946.         new_manual_page(yyvsp[-2].text,&yyvsp[-1].parameter.decl_spec,yyvsp[-1].parameter.declarator);
  947.         safe_free(yyvsp[0].text);
  948.     ;
  949.     break;}
  950. case 9:
  951. #line 132 "/grammar.y"
  952. {
  953.         free_declarator(yyvsp[-2].parameter.declarator);
  954.         free_decl_spec(&yyvsp[-2].parameter.decl_spec);
  955.         safe_free(yyvsp[0].text);
  956.     ;
  957.     break;}
  958. case 10:
  959. #line 138 "/grammar.y"
  960. {
  961.         new_manual_page(yyvsp[-3].text,&yyvsp[-2].parameter.decl_spec,yyvsp[-2].parameter.declarator);
  962.         safe_free(yyvsp[0].text);
  963.     ;
  964.     break;}
  965. case 12:
  966. #line 144 "/grammar.y"
  967. {
  968.         if (inbasefile && first_comment)
  969.         {
  970.         remember_terse(yyvsp[0].text);
  971.         first_comment = FALSE;
  972.         }
  973.         free(yyvsp[0].text);
  974.     ;
  975.     break;}
  976. case 13:
  977. #line 153 "/grammar.y"
  978. {
  979.         free(yyvsp[0].text);
  980.     ;
  981.     break;}
  982. case 14:
  983. #line 157 "/grammar.y"
  984. {
  985.         inbasefile = yyvsp[0].boolean;
  986.     ;
  987.     break;}
  988. case 15:
  989. #line 161 "/grammar.y"
  990. {
  991.         yyerrok;
  992.     ;
  993.     break;}
  994. case 16:
  995. #line 168 "/grammar.y"
  996. {
  997.         /* Provide an empty action here so bison will not complain about
  998.          * incompatible types in the default action it normally would
  999.          * have generated.
  1000.          */
  1001.     ;
  1002.     break;}
  1003. case 17:
  1004. #line 175 "/grammar.y"
  1005. {
  1006.         /* empty */
  1007.     ;
  1008.     break;}
  1009. case 18:
  1010. #line 182 "/grammar.y"
  1011. {
  1012.         if (yyvsp[-1].declarator->type != DECL_FUNCTION) {
  1013.         yyerror("syntax error");
  1014.         YYERROR;
  1015.         }
  1016.         func_params = &(yyvsp[-1].declarator->head->params);
  1017.             if (yyvsp[0].text)    comment_last_parameter(&yyvsp[-1].declarator->head->params, yyvsp[0].text);
  1018.     ;
  1019.     break;}
  1020. case 19:
  1021. #line 191 "/grammar.y"
  1022. {
  1023.         func_params = NULL;
  1024.         yyvsp[-4].declarator->type = DECL_FUNCDEF;
  1025.  
  1026.         yyval.parameter.decl_spec = yyvsp[-5].decl_spec;
  1027.         yyval.parameter.declarator = yyvsp[-4].declarator;
  1028.     ;
  1029.     break;}
  1030. case 20:
  1031. #line 199 "/grammar.y"
  1032. {
  1033.         if (yyvsp[-1].declarator->type != DECL_FUNCTION) {
  1034.         yyerror("syntax error");
  1035.         YYERROR;
  1036.         }
  1037.         func_params = &(yyvsp[-1].declarator->head->params);
  1038.             if (yyvsp[0].text)    comment_last_parameter(&yyvsp[-1].declarator->head->params, yyvsp[0].text);
  1039.     ;
  1040.     break;}
  1041. case 21:
  1042. #line 208 "/grammar.y"
  1043. {
  1044.         DeclSpec    decl_spec;
  1045.  
  1046.         func_params = NULL;
  1047.         yyvsp[-4].declarator->type = DECL_FUNCDEF;
  1048.  
  1049.         new_decl_spec(&yyval.parameter.decl_spec, "int", DS_NONE);
  1050.         yyval.parameter.declarator = yyvsp[-4].declarator;
  1051.     ;
  1052.     break;}
  1053. case 22:
  1054. #line 221 "/grammar.y"
  1055. {
  1056.         yyval.declaration.decl_spec = yyvsp[-1].decl_spec;
  1057.         yyval.declaration.decl_list.first = NULL;
  1058.     ;
  1059.     break;}
  1060. case 23:
  1061. #line 226 "/grammar.y"
  1062. {
  1063.         yyval.declaration.decl_spec = yyvsp[-2].decl_spec;
  1064.         yyval.declaration.decl_list = yyvsp[-1].decl_list;
  1065.     ;
  1066.     break;}
  1067. case 24:
  1068. #line 231 "/grammar.y"
  1069. {
  1070.         new_typedef_symbols(&yyvsp[-2].decl_spec,&yyvsp[-1].decl_list);
  1071.         yyval.declaration.decl_spec = yyvsp[-2].decl_spec;
  1072.         yyval.declaration.decl_list = yyvsp[-1].decl_list;
  1073.     ;
  1074.     break;}
  1075. case 25:
  1076. #line 240 "/grammar.y"
  1077. {
  1078.         new_decl_list(&yyval.decl_list, yyvsp[0].declarator);
  1079.     ;
  1080.     break;}
  1081. case 26:
  1082. #line 244 "/grammar.y"
  1083. {
  1084.             if (yyvsp[-1].text)    comment_last_decl(&yyvsp[-3].decl_list, yyvsp[-1].text);
  1085.             add_decl_list(&yyval.decl_list, &yyvsp[-3].decl_list, yyvsp[0].declarator);
  1086.         ;
  1087.     break;}
  1088. case 27:
  1089. #line 249 "/grammar.y"
  1090. {
  1091.             yyval.decl_list = yyvsp[-1].decl_list;
  1092.             if (yyvsp[0].text)    comment_last_decl(&yyvsp[-1].decl_list, yyvsp[0].text);
  1093.         ;
  1094.     break;}
  1095. case 31:
  1096. #line 263 "/grammar.y"
  1097. {
  1098.         set_param_types(func_params, &yyvsp[-1].declaration.decl_spec, &yyvsp[-1].declaration.decl_list, yyvsp[-2].text, yyvsp[0].text);
  1099.     ;
  1100.     break;}
  1101. case 32:
  1102. #line 267 "/grammar.y"
  1103. {
  1104.         set_param_types(func_params, &yyvsp[-1].declaration.decl_spec, &yyvsp[-1].declaration.decl_list, yyvsp[-2].text, yyvsp[0].text);
  1105.     ;
  1106.     break;}
  1107. case 34:
  1108. #line 275 "/grammar.y"
  1109. {
  1110.         join_decl_specs(&yyval.decl_spec, &yyvsp[-1].decl_spec, &yyvsp[0].decl_spec);
  1111.     ;
  1112.     break;}
  1113. case 38:
  1114. #line 288 "/grammar.y"
  1115. {
  1116.         new_decl_spec(&yyval.decl_spec, "auto", DS_NONE);
  1117.     ;
  1118.     break;}
  1119. case 39:
  1120. #line 292 "/grammar.y"
  1121. {
  1122.         new_decl_spec(&yyval.decl_spec, "extern", DS_EXTERN);
  1123.     ;
  1124.     break;}
  1125. case 40:
  1126. #line 296 "/grammar.y"
  1127. {
  1128.         new_decl_spec(&yyval.decl_spec, "register", DS_NONE);
  1129.     ;
  1130.     break;}
  1131. case 41:
  1132. #line 300 "/grammar.y"
  1133. {
  1134.         new_decl_spec(&yyval.decl_spec, "static", DS_STATIC);
  1135.     ;
  1136.     break;}
  1137. case 42:
  1138. #line 304 "/grammar.y"
  1139. {
  1140.         new_decl_spec(&yyval.decl_spec, "inline", DS_INLINE);
  1141.     ;
  1142.     break;}
  1143. case 43:
  1144. #line 311 "/grammar.y"
  1145. {
  1146.         new_decl_spec(&yyval.decl_spec, "char", DS_CHAR);
  1147.     ;
  1148.     break;}
  1149. case 44:
  1150. #line 315 "/grammar.y"
  1151. {
  1152.         new_decl_spec(&yyval.decl_spec, "double", DS_NONE);
  1153.     ;
  1154.     break;}
  1155. case 45:
  1156. #line 319 "/grammar.y"
  1157. {
  1158.         new_decl_spec(&yyval.decl_spec, "float", DS_FLOAT);
  1159.     ;
  1160.     break;}
  1161. case 46:
  1162. #line 323 "/grammar.y"
  1163. {
  1164.         new_decl_spec(&yyval.decl_spec, "int", DS_NONE);
  1165.     ;
  1166.     break;}
  1167. case 47:
  1168. #line 327 "/grammar.y"
  1169. {
  1170.         new_decl_spec(&yyval.decl_spec, "long", DS_NONE);
  1171.     ;
  1172.     break;}
  1173. case 48:
  1174. #line 331 "/grammar.y"
  1175. {
  1176.         new_decl_spec(&yyval.decl_spec, "short", DS_SHORT);
  1177.     ;
  1178.     break;}
  1179. case 49:
  1180. #line 335 "/grammar.y"
  1181. {
  1182.         new_decl_spec(&yyval.decl_spec, "signed", DS_NONE);
  1183.     ;
  1184.     break;}
  1185. case 50:
  1186. #line 339 "/grammar.y"
  1187. {
  1188.         new_decl_spec(&yyval.decl_spec, "unsigned", DS_NONE);
  1189.     ;
  1190.     break;}
  1191. case 51:
  1192. #line 343 "/grammar.y"
  1193. {
  1194.         new_decl_spec(&yyval.decl_spec, "void", DS_NONE);
  1195.     ;
  1196.     break;}
  1197. case 54:
  1198. #line 349 "/grammar.y"
  1199. {
  1200.         Symbol *s = find_symbol(typedef_names, yyvsp[0].text);
  1201.        
  1202.         new_enum_decl_spec(&yyval.decl_spec, yyvsp[0].text, s->flags,
  1203.         s->valtype == SYMVAL_ENUM ? s->value.enum_list
  1204.                       : (EnumeratorList *)NULL);
  1205.     ;
  1206.     break;}
  1207. case 55:
  1208. #line 360 "/grammar.y"
  1209. {
  1210.         new_decl_spec(&yyval.decl_spec, "const", DS_NONE);
  1211.     ;
  1212.     break;}
  1213. case 56:
  1214. #line 364 "/grammar.y"
  1215. {
  1216.         new_decl_spec(&yyval.decl_spec, "volatile", DS_NONE);
  1217.     ;
  1218.     break;}
  1219. case 57:
  1220. #line 368 "/grammar.y"
  1221. {
  1222.         new_decl_spec(&yyval.decl_spec, "cdecl", DS_NONE);
  1223.     ;
  1224.     break;}
  1225. case 58:
  1226. #line 372 "/grammar.y"
  1227. {
  1228.         new_decl_spec(&yyval.decl_spec, "interrupt", DS_NONE);
  1229.     ;
  1230.     break;}
  1231. case 59:
  1232. #line 376 "/grammar.y"
  1233. {
  1234.         new_decl_spec(&yyval.decl_spec, "far", DS_NONE);
  1235.     ;
  1236.     break;}
  1237. case 60:
  1238. #line 380 "/grammar.y"
  1239. {
  1240.         new_decl_spec(&yyval.decl_spec, "huge", DS_NONE);
  1241.     ;
  1242.     break;}
  1243. case 61:
  1244. #line 384 "/grammar.y"
  1245. {
  1246.         new_decl_spec(&yyval.decl_spec, "near", DS_NONE);
  1247.     ;
  1248.     break;}
  1249. case 62:
  1250. #line 388 "/grammar.y"
  1251. {
  1252.         new_decl_spec(&yyval.decl_spec, "pascal", DS_NONE);
  1253.     ;
  1254.     break;}
  1255. case 63:
  1256. #line 395 "/grammar.y"
  1257. {
  1258.         dyn_decl_spec(&yyval.decl_spec, strconcat(yyvsp[-2].text, " ",yyvsp[-1].text," {}",NULLCP), DS_NONE);
  1259.         free(yyvsp[-1].text);
  1260.     ;
  1261.     break;}
  1262. case 64:
  1263. #line 400 "/grammar.y"
  1264. {
  1265.         dyn_decl_spec(&yyval.decl_spec, strconcat(yyvsp[-1].text," {}",NULLCP), DS_NONE);
  1266.     ;
  1267.     break;}
  1268. case 65:
  1269. #line 404 "/grammar.y"
  1270. {
  1271.         dyn_decl_spec(&yyval.decl_spec, strconcat(yyvsp[-1].text, " ",yyvsp[0].text,NULLCP), DS_NONE);
  1272.         free(yyvsp[0].text);
  1273.     ;
  1274.     break;}
  1275. case 66:
  1276. #line 412 "/grammar.y"
  1277. {
  1278.         yyval.text = "struct";
  1279.     ;
  1280.     break;}
  1281. case 67:
  1282. #line 416 "/grammar.y"
  1283. {
  1284.         yyval.text = "union";
  1285.     ;
  1286.     break;}
  1287. case 68:
  1288. #line 423 "/grammar.y"
  1289. {
  1290.         new_decl_list(&yyval.decl_list, yyvsp[0].declarator);
  1291.     ;
  1292.     break;}
  1293. case 69:
  1294. #line 427 "/grammar.y"
  1295. {
  1296.             if (yyvsp[-1].text)    comment_last_decl(&yyvsp[-3].decl_list, yyvsp[-1].text);
  1297.             add_decl_list(&yyval.decl_list, &yyvsp[-3].decl_list, yyvsp[0].declarator);
  1298.         ;
  1299.     break;}
  1300. case 70:
  1301. #line 432 "/grammar.y"
  1302. {
  1303.             yyval.decl_list = yyvsp[-1].decl_list;
  1304.             if (yyvsp[0].text)    comment_last_decl(&yyvsp[-1].decl_list, yyvsp[0].text);
  1305.         ;
  1306.     break;}
  1307. case 73:
  1308. #line 445 "/grammar.y"
  1309. {
  1310.         add_enum_symbol(yyvsp[-4].text, yyvsp[-1].enum_list);
  1311.         new_enum_decl_spec(&yyval.decl_spec, strconcat("enum ",yyvsp[-4].text," {}",NULLCP),
  1312.            DS_NONE, yyvsp[-1].enum_list);
  1313.         free(yyvsp[-4].text);
  1314.         safe_free(yyvsp[-2].text);
  1315.         enum_state = NOENUM;
  1316.     ;
  1317.     break;}
  1318. case 74:
  1319. #line 454 "/grammar.y"
  1320. {
  1321.         new_enum_decl_spec(&yyval.decl_spec, strduplicate("enum {}"), DS_NONE, yyvsp[-1].enum_list);
  1322.         safe_free(yyvsp[-2].text);
  1323.         enum_state = NOENUM;
  1324.     ;
  1325.     break;}
  1326. case 75:
  1327. #line 460 "/grammar.y"
  1328. {
  1329.         new_enum_decl_spec(&yyval.decl_spec, strconcat("enum ",yyvsp[0].text,NULLCP), DS_NONE,
  1330.             find_enum_symbol(yyvsp[0].text));
  1331.         free(yyvsp[0].text);
  1332.         enum_state = NOENUM;
  1333.     ;
  1334.     break;}
  1335. case 76:
  1336. #line 470 "/grammar.y"
  1337. {
  1338.         yyval.enum_list = new_enumerator_list(&yyvsp[0].enumerator);
  1339.     ;
  1340.     break;}
  1341. case 77:
  1342. #line 474 "/grammar.y"
  1343. {
  1344.         yyval.enum_list = yyvsp[-3].enum_list;
  1345.         if (yyvsp[-1].text)    comment_last_enumerator(yyval.enum_list, yyvsp[-1].text);
  1346.         add_enumerator_list(yyval.enum_list, &yyvsp[0].enumerator);
  1347.     ;
  1348.     break;}
  1349. case 78:
  1350. #line 480 "/grammar.y"
  1351. {
  1352.         yyval.enum_list = yyvsp[-1].enum_list;
  1353.         if (yyvsp[0].text)    comment_last_enumerator(yyval.enum_list, yyvsp[0].text);
  1354.     ;
  1355.     break;}
  1356. case 79:
  1357. #line 485 "/grammar.y"
  1358. {
  1359.         yyval.enum_list = yyvsp[-2].enum_list;
  1360.         if (yyvsp[0].text)     comment_last_enumerator(yyval.enum_list, yyvsp[0].text);
  1361.     ;
  1362.     break;}
  1363. case 80:
  1364. #line 493 "/grammar.y"
  1365. {
  1366.         new_enumerator(&yyval.enumerator,yyvsp[0].identifier.name,yyvsp[0].identifier.comment_before,yyvsp[0].identifier.comment_after);
  1367.     ;
  1368.     break;}
  1369. case 83:
  1370. #line 502 "/grammar.y"
  1371. {
  1372.         yyval.text = yyvsp[-1].text;
  1373.         free(yyvsp[0].text);
  1374.     ;
  1375.     break;}
  1376. case 84:
  1377. #line 507 "/grammar.y"
  1378. {
  1379.         yyval.text = yyvsp[-1].text;
  1380.         free(yyvsp[0].text);
  1381.     ;
  1382.     break;}
  1383. case 85:
  1384. #line 515 "/grammar.y"
  1385. {
  1386.         char *newtext = strappend(yyvsp[-1].text,yyvsp[0].declarator->text,NULLCP);
  1387.         free(yyvsp[0].declarator->text);
  1388.         yyval.declarator = yyvsp[0].declarator;
  1389.         yyval.declarator->text = newtext;
  1390.         if (yyval.declarator->type == DECL_SIMPLE)
  1391.         yyval.declarator->type = DECL_COMPOUND;
  1392.     ;
  1393.     break;}
  1394. case 87:
  1395. #line 528 "/grammar.y"
  1396. {
  1397.         yyval.declarator = new_declarator(yyvsp[0].text, strduplicate(yyvsp[0].text));
  1398.     ;
  1399.     break;}
  1400. case 88:
  1401. #line 532 "/grammar.y"
  1402. {
  1403.         char *newtext = strconcat("(",yyvsp[-1].declarator->text,")",NULLCP);
  1404.         free(yyvsp[-1].declarator->text);
  1405.         yyval.declarator = yyvsp[-1].declarator;
  1406.         yyval.declarator->text = newtext;
  1407.     ;
  1408.     break;}
  1409. case 89:
  1410. #line 539 "/grammar.y"
  1411. {
  1412.         yyval.declarator = yyvsp[-1].declarator;
  1413.         yyval.declarator->text = strappend(yyvsp[-1].declarator->text,yyvsp[0].text,NULLCP);
  1414.         free(yyvsp[0].text);
  1415.     ;
  1416.     break;}
  1417. case 90:
  1418. #line 545 "/grammar.y"
  1419. {
  1420.         yyval.declarator = new_declarator(strduplicate("%s()"), strduplicate(yyvsp[-3].declarator->name));
  1421.         yyval.declarator->params = yyvsp[-1].param_list;
  1422.         yyval.declarator->func_stack = yyvsp[-3].declarator;
  1423.         yyval.declarator->head = (yyvsp[-3].declarator->func_stack == NULL) ? yyval.declarator : yyvsp[-3].declarator->head;
  1424.         yyval.declarator->type = (yyvsp[-3].declarator->type == DECL_SIMPLE) ? DECL_FUNCTION : yyvsp[-3].declarator->type;
  1425.     ;
  1426.     break;}
  1427. case 91:
  1428. #line 553 "/grammar.y"
  1429. {
  1430.         yyval.declarator = new_declarator(strduplicate("%s()"), strduplicate(yyvsp[-3].declarator->name));
  1431.         yyval.declarator->params = yyvsp[-1].param_list;
  1432.         yyval.declarator->func_stack = yyvsp[-3].declarator;
  1433.         yyval.declarator->head = (yyvsp[-3].declarator->func_stack == NULL) ? yyval.declarator : yyvsp[-3].declarator->head;
  1434.         yyval.declarator->type = (yyvsp[-3].declarator->type == DECL_SIMPLE) ? DECL_FUNCTION : yyvsp[-3].declarator->type;
  1435.     ;
  1436.     break;}
  1437. case 92:
  1438. #line 564 "/grammar.y"
  1439. {
  1440.         yyval.text = strconcat("*",yyvsp[0].text, NULLCP);
  1441.         safe_free(yyvsp[0].text);
  1442.     ;
  1443.     break;}
  1444. case 93:
  1445. #line 569 "/grammar.y"
  1446. {
  1447.         yyval.text = yyvsp[-1].text ? strconcat("*",yyvsp[-1].text, yyvsp[0].text, NULLCP)
  1448.             : strconcat("*", yyvsp[0].text, NULLCP);
  1449.         safe_free(yyvsp[-1].text);
  1450.         free(yyvsp[0].text);
  1451.     ;
  1452.     break;}
  1453. case 94:
  1454. #line 579 "/grammar.y"
  1455. {
  1456.         yyval.text = NULL;
  1457.     ;
  1458.     break;}
  1459. case 95:
  1460. #line 583 "/grammar.y"
  1461. {
  1462.         yyval.text = yyvsp[-1].text ? strconcat(yyvsp[-1].text," ",yyvsp[0].decl_spec.text," ",NULLCP)
  1463.             : strconcat(yyvsp[0].decl_spec.text," ",NULLCP);
  1464.         safe_free(yyvsp[-1].text);
  1465.         free_decl_spec(&yyvsp[0].decl_spec);
  1466.     ;
  1467.     break;}
  1468. case 96:
  1469. #line 593 "/grammar.y"
  1470. {
  1471.         yyval.param_list = yyvsp[-1].param_list;
  1472.         if (yyvsp[0].text)    comment_last_parameter(&yyvsp[-1].param_list, yyvsp[0].text);
  1473.     ;
  1474.     break;}
  1475. case 97:
  1476. #line 599 "/grammar.y"
  1477. {
  1478.         Identifier ellipsis;
  1479.  
  1480.         if (yyvsp[-4].text)    comment_last_parameter(&yyvsp[-6].param_list, yyvsp[-4].text);
  1481.         ellipsis.name = strduplicate("...");
  1482.  
  1483.         if (yyvsp[-3].text && yyvsp[-1].text && yyvsp[0].text)
  1484.         {
  1485.         yyerror("ellipsis parameter has multiple comments");
  1486.         free(yyvsp[0].text);
  1487.         free(yyvsp[-1].text);
  1488.         free(yyvsp[-3].text);
  1489.         ellipsis.comment_before = ellipsis.comment_after = NULL;
  1490.         }
  1491.         else
  1492.         {
  1493.         ellipsis.comment_before = yyvsp[-3].text;
  1494.         ellipsis.comment_after = yyvsp[-1].text ? yyvsp[-1].text : yyvsp[0].text;
  1495.         }
  1496.  
  1497.         add_ident_list(&yyval.param_list, &yyvsp[-6].param_list, &ellipsis);
  1498.     ;
  1499.     break;}
  1500. case 98:
  1501. #line 625 "/grammar.y"
  1502. {
  1503.         new_param_list(&yyval.param_list, &yyvsp[0].parameter);
  1504.     ;
  1505.     break;}
  1506. case 99:
  1507. #line 629 "/grammar.y"
  1508. {
  1509.         if (yyvsp[-1].text)    comment_last_parameter(&yyvsp[-3].param_list, yyvsp[-1].text);
  1510.         add_param_list(&yyval.param_list, &yyvsp[-3].param_list, &yyvsp[0].parameter);
  1511.     ;
  1512.     break;}
  1513. case 100:
  1514. #line 637 "/grammar.y"
  1515. {
  1516.         new_parameter(&yyval.parameter, &yyvsp[-2].decl_spec, yyvsp[-1].declarator, yyvsp[-3].text, yyvsp[0].text);
  1517.     ;
  1518.     break;}
  1519. case 101:
  1520. #line 641 "/grammar.y"
  1521. {
  1522.         new_parameter(&yyval.parameter, &yyvsp[-2].decl_spec, yyvsp[-1].declarator, yyvsp[-3].text, yyvsp[0].text);
  1523.     ;
  1524.     break;}
  1525. case 102:
  1526. #line 645 "/grammar.y"
  1527. {
  1528.         new_parameter(&yyval.parameter, &yyvsp[-1].decl_spec, (Declarator *)NULL, yyvsp[-2].text, yyvsp[0].text);
  1529.     ;
  1530.     break;}
  1531. case 103:
  1532. #line 652 "/grammar.y"
  1533. {
  1534.         new_ident_list(&yyval.param_list);
  1535.     ;
  1536.     break;}
  1537. case 104:
  1538. #line 656 "/grammar.y"
  1539. {
  1540.         yyval.param_list = yyvsp[-1].param_list;
  1541.         if (yyvsp[0].text)    comment_last_parameter(&yyvsp[-1].param_list, yyvsp[0].text);
  1542.     ;
  1543.     break;}
  1544. case 105:
  1545. #line 664 "/grammar.y"
  1546. {
  1547.         new_ident_list(&yyval.param_list);
  1548.         add_ident_list(&yyval.param_list, &yyval.param_list, &yyvsp[0].identifier);
  1549.     ;
  1550.     break;}
  1551. case 106:
  1552. #line 669 "/grammar.y"
  1553. {
  1554.         if (yyvsp[-1].text)    comment_last_parameter(&yyvsp[-3].param_list, yyvsp[-1].text);
  1555.         add_ident_list(&yyval.param_list, &yyvsp[-3].param_list, &yyvsp[0].identifier);
  1556.     ;
  1557.     break;}
  1558. case 107:
  1559. #line 677 "/grammar.y"
  1560. {
  1561.         yyval.identifier.comment_before = yyvsp[-2].text;
  1562.         yyval.identifier.comment_after = yyvsp[0].text;
  1563.         yyval.identifier.name = yyvsp[-1].text;
  1564.     ;
  1565.     break;}
  1566. case 108:
  1567. #line 685 "/grammar.y"
  1568. {
  1569.         yyval.declarator = new_declarator(yyvsp[0].text, NULLCP);
  1570.     ;
  1571.     break;}
  1572. case 109:
  1573. #line 689 "/grammar.y"
  1574. {
  1575.         char *newtext = strappend(yyvsp[-1].text,yyvsp[0].declarator->text,NULLCP);
  1576.         free(yyvsp[0].declarator->text);
  1577.         yyval.declarator = yyvsp[0].declarator;
  1578.         yyval.declarator->text = newtext;
  1579.         if (yyval.declarator->type == DECL_SIMPLE)
  1580.         yyval.declarator->type = DECL_COMPOUND;
  1581.     ;
  1582.     break;}
  1583. case 111:
  1584. #line 702 "/grammar.y"
  1585. {
  1586.         char *newtext = strconcat("(",yyvsp[-1].declarator->text,")",NULLCP);
  1587.         free(yyvsp[-1].declarator->text);
  1588.         yyval.declarator = yyvsp[-1].declarator;
  1589.         yyval.declarator->text = newtext;
  1590.     ;
  1591.     break;}
  1592. case 112:
  1593. #line 709 "/grammar.y"
  1594. {
  1595.         yyval.declarator = yyvsp[-1].declarator;
  1596.         yyval.declarator->text = strappend(yyvsp[-1].declarator->text,yyvsp[0].text,NULLCP);
  1597.         free(yyvsp[0].text);
  1598.     ;
  1599.     break;}
  1600. case 113:
  1601. #line 715 "/grammar.y"
  1602. {
  1603.         yyval.declarator = new_declarator(yyvsp[0].text, NULLCP);
  1604.     ;
  1605.     break;}
  1606. case 114:
  1607. #line 719 "/grammar.y"
  1608. {
  1609.         yyval.declarator = new_declarator(strduplicate("%s()"), NULLCP);
  1610.         yyval.declarator->params = yyvsp[-1].param_list;
  1611.         yyval.declarator->func_stack = yyvsp[-3].declarator;
  1612.         yyval.declarator->head = (yyvsp[-3].declarator->func_stack == NULL) ? yyval.declarator : yyvsp[-3].declarator->head;
  1613.         yyval.declarator->type = (yyvsp[-3].declarator->type == DECL_SIMPLE) ? DECL_FUNCTION : yyvsp[-3].declarator->type;
  1614.     ;
  1615.     break;}
  1616. case 115:
  1617. #line 727 "/grammar.y"
  1618. {
  1619.         yyval.declarator = new_declarator(strduplicate("%s()"), NULLCP);
  1620.         yyval.declarator->func_stack = yyvsp[-2].declarator;
  1621.         yyval.declarator->head = (yyvsp[-2].declarator->func_stack == NULL) ? yyval.declarator : yyvsp[-2].declarator->head;
  1622.         yyval.declarator->type = (yyvsp[-2].declarator->type == DECL_SIMPLE) ? DECL_FUNCTION : yyvsp[-2].declarator->type;
  1623.     ;
  1624.     break;}
  1625. case 116:
  1626. #line 734 "/grammar.y"
  1627. {
  1628.         Declarator *d;
  1629.         
  1630.         d = new_declarator(NULL, NULL);
  1631.         yyval.declarator = new_declarator(strduplicate("%s()"), NULLCP);
  1632.         yyval.declarator->params = yyvsp[-1].param_list;
  1633.         yyval.declarator->func_stack = d;
  1634.         yyval.declarator->head = yyval.declarator;
  1635.     ;
  1636.     break;}
  1637. case 117:
  1638. #line 744 "/grammar.y"
  1639. {
  1640.         Declarator *d;
  1641.         
  1642.         d = new_declarator(NULL, NULL);
  1643.         yyval.declarator = new_declarator(strduplicate("%s()"), NULLCP);
  1644.         yyval.declarator->func_stack = d;
  1645.         yyval.declarator->head = yyval.declarator;
  1646.     ;
  1647.     break;}
  1648. case 118:
  1649. #line 756 "/grammar.y"
  1650. {
  1651.         yyval.text = NULL;
  1652.     ;
  1653.     break;}
  1654. case 120:
  1655. #line 764 "/grammar.y"
  1656. {
  1657.         yyval.text = NULL;
  1658.     ;
  1659.     break;}
  1660. }
  1661.    /* the action file gets copied in in place of this dollarsign */
  1662. #line 465 "bison.simple"
  1663.  
  1664.   yyvsp -= yylen;
  1665.   yyssp -= yylen;
  1666. #ifdef YYLSP_NEEDED
  1667.   yylsp -= yylen;
  1668. #endif
  1669.  
  1670. #if YYDEBUG != 0
  1671.   if (yydebug)
  1672.     {
  1673.       short *ssp1 = yyss - 1;
  1674.       fprintf (stderr, "state stack now");
  1675.       while (ssp1 != yyssp)
  1676.         fprintf (stderr, " %d", *++ssp1);
  1677.       fprintf (stderr, "\n");
  1678.     }
  1679. #endif
  1680.  
  1681.   *++yyvsp = yyval;
  1682.  
  1683. #ifdef YYLSP_NEEDED
  1684.   yylsp++;
  1685.   if (yylen == 0)
  1686.     {
  1687.       yylsp->first_line = yylloc.first_line;
  1688.       yylsp->first_column = yylloc.first_column;
  1689.       yylsp->last_line = (yylsp-1)->last_line;
  1690.       yylsp->last_column = (yylsp-1)->last_column;
  1691.       yylsp->text = 0;
  1692.     }
  1693.   else
  1694.     {
  1695.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  1696.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  1697.     }
  1698. #endif
  1699.  
  1700.   /* Now "shift" the result of the reduction.
  1701.      Determine what state that goes to,
  1702.      based on the state we popped back to
  1703.      and the rule number reduced by.  */
  1704.  
  1705.   yyn = yyr1[yyn];
  1706.  
  1707.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  1708.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  1709.     yystate = yytable[yystate];
  1710.   else
  1711.     yystate = yydefgoto[yyn - YYNTBASE];
  1712.  
  1713.   goto yynewstate;
  1714.  
  1715. yyerrlab:   /* here on detecting error */
  1716.  
  1717.   if (! yyerrstatus)
  1718.     /* If not already recovering from an error, report this error.  */
  1719.     {
  1720.       ++yynerrs;
  1721.  
  1722. #ifdef YYERROR_VERBOSE
  1723.       yyn = yypact[yystate];
  1724.  
  1725.       if (yyn > YYFLAG && yyn < YYLAST)
  1726.         {
  1727.           int size = 0;
  1728.           char *msg;
  1729.           int x, count;
  1730.  
  1731.           count = 0;
  1732.           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
  1733.           for (x = (yyn < 0 ? -yyn : 0);
  1734.                x < (sizeof(yytname) / sizeof(char *)); x++)
  1735.             if (yycheck[x + yyn] == x)
  1736.               size += strlen(yytname[x]) + 15, count++;
  1737.           msg = (char *) malloc(size + 15);
  1738.           if (msg != 0)
  1739.             {
  1740.               strcpy(msg, "parse error");
  1741.  
  1742.               if (count < 5)
  1743.                 {
  1744.                   count = 0;
  1745.                   for (x = (yyn < 0 ? -yyn : 0);
  1746.                        x < (sizeof(yytname) / sizeof(char *)); x++)
  1747.                     if (yycheck[x + yyn] == x)
  1748.                       {
  1749.                         strcat(msg, count == 0 ? ", expecting `" : " or `");
  1750.                         strcat(msg, yytname[x]);
  1751.                         strcat(msg, "'");
  1752.                         count++;
  1753.                       }
  1754.                 }
  1755.               yyerror(msg);
  1756.               free(msg);
  1757.             }
  1758.           else
  1759.             yyerror ("parse error; also virtual memory exceeded");
  1760.         }
  1761.       else
  1762. #endif /* YYERROR_VERBOSE */
  1763.         yyerror("parse error");
  1764.     }
  1765.  
  1766.   goto yyerrlab1;
  1767. yyerrlab1:   /* here on error raised explicitly by an action */
  1768.  
  1769.   if (yyerrstatus == 3)
  1770.     {
  1771.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  1772.  
  1773.       /* return failure if at end of input */
  1774.       if (yychar == YYEOF)
  1775.         YYABORT;
  1776.  
  1777. #if YYDEBUG != 0
  1778.       if (yydebug)
  1779.         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  1780. #endif
  1781.  
  1782.       yychar = YYEMPTY;
  1783.     }
  1784.  
  1785.   /* Else will try to reuse lookahead token
  1786.      after shifting the error token.  */
  1787.  
  1788.   yyerrstatus = 3;              /* Each real token shifted decrements this */
  1789.  
  1790.   goto yyerrhandle;
  1791.  
  1792. yyerrdefault:  /* current state does not do anything special for the error token. */
  1793.  
  1794. #if 0
  1795.   /* This is wrong; only states that explicitly want error tokens
  1796.      should shift them.  */
  1797.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1798.   if (yyn) goto yydefault;
  1799. #endif
  1800.  
  1801. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1802.  
  1803.   if (yyssp == yyss) YYABORT;
  1804.   yyvsp--;
  1805.   yystate = *--yyssp;
  1806. #ifdef YYLSP_NEEDED
  1807.   yylsp--;
  1808. #endif
  1809.  
  1810. #if YYDEBUG != 0
  1811.   if (yydebug)
  1812.     {
  1813.       short *ssp1 = yyss - 1;
  1814.       fprintf (stderr, "Error: state stack now");
  1815.       while (ssp1 != yyssp)
  1816.         fprintf (stderr, " %d", *++ssp1);
  1817.       fprintf (stderr, "\n");
  1818.     }
  1819. #endif
  1820.  
  1821. yyerrhandle:
  1822.  
  1823.   yyn = yypact[yystate];
  1824.   if (yyn == YYFLAG)
  1825.     goto yyerrdefault;
  1826.  
  1827.   yyn += YYTERROR;
  1828.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1829.     goto yyerrdefault;
  1830.  
  1831.   yyn = yytable[yyn];
  1832.   if (yyn < 0)
  1833.     {
  1834.       if (yyn == YYFLAG)
  1835.         goto yyerrpop;
  1836.       yyn = -yyn;
  1837.       goto yyreduce;
  1838.     }
  1839.   else if (yyn == 0)
  1840.     goto yyerrpop;
  1841.  
  1842.   if (yyn == YYFINAL)
  1843.     YYACCEPT;
  1844.  
  1845. #if YYDEBUG != 0
  1846.   if (yydebug)
  1847.     fprintf(stderr, "Shifting error token, ");
  1848. #endif
  1849.  
  1850.   *++yyvsp = yylval;
  1851. #ifdef YYLSP_NEEDED
  1852.   *++yylsp = yylloc;
  1853. #endif
  1854.  
  1855.   yystate = yyn;
  1856.   goto yynewstate;
  1857. }
  1858. #line 770 "/grammar.y"
  1859.  
  1860. #ifdef MSDOS
  1861. #include "lex_yy.c"
  1862. #else
  1863. #ifdef VMS
  1864. #include "lexyy.c"
  1865. #else
  1866. #include "lex.yy.c"
  1867. #endif /* !VMS   */
  1868. #endif /* !MSDOS */
  1869.  
  1870. #ifdef I_STDARG
  1871. void yyerror(const char *format, ...)
  1872. #else
  1873. void yyerror(va_alist)
  1874.     va_dcl
  1875. #endif
  1876. {
  1877. #ifndef I_STDARG
  1878.     const char *format;
  1879. #endif
  1880.     va_list args;
  1881.  
  1882.     output_error();
  1883.  
  1884. #ifdef I_STDARG
  1885.     va_start(args, format);
  1886. #else
  1887.     va_start(args);
  1888.     format = va_arg(args, char *);
  1889. #endif
  1890.  
  1891.     vfprintf(stderr, format, args);
  1892.     va_end(args);
  1893.     putc('.',stderr);
  1894.     putc('\n',stderr);
  1895. }
  1896.  
  1897. void
  1898. parse_file (start_file)
  1899. const char *start_file;
  1900. {
  1901.     const char *s;
  1902. #ifdef FLEX_SCANNER
  1903.     static boolean restart = FALSE;
  1904. #endif
  1905.  
  1906.     cur_file = start_file ? strduplicate(start_file) : NULL;
  1907.  
  1908.     if (basefile && strlen(basefile) > 2) {
  1909.     s = basefile + strlen(basefile) - 2;
  1910.     if (strcmp(s, ".l") == 0 || strcmp(s, ".y") == 0)
  1911.         BEGIN LEXYACC;
  1912.     }
  1913.  
  1914.     typedef_names = create_symbol_table();
  1915.     enum_table = create_symbol_table();
  1916.  
  1917.     line_num = 1;
  1918.     ly_count = 0;
  1919.     first_comment = group_together && !terse_specified;
  1920.  
  1921.     /* flex needs a yyrestart before every file but the first */
  1922. #ifdef FLEX_SCANNER
  1923.     if (restart)    yyrestart(yyin);
  1924.     restart = TRUE;
  1925. #endif
  1926.  
  1927.     yyparse();
  1928.  
  1929.     destroy_symbol_table(enum_table);
  1930.     destroy_symbol_table(typedef_names);
  1931.  
  1932.     safe_free(cur_file);
  1933. }
  1934.